package 蓝桥真题;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;

public class 考勤刷卡 {
       static BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
       final static int N=10010;
       static int a[]=new int[N],n;
       
       public static void main(String[] ss) throws IOException {
		      n=Integer.parseInt(br.readLine());
		      for(int i=0;i<n;i++){
		    	  ss=br.readLine().split(" ");
		    	  a[i]=Integer.parseInt(ss[1]);
		      }
		      Arrays.sort(a,0,n);
		      
		      int j=0;
		      for(int i=0;i<n;i++){
		    	  if(i==0||a[i]!=a[i-1]){
		    		  a[j++]=a[i];
		    	  }
		      }
		      for(int i=0;i<j;i++)
		    	  System.out.print(a[i]+" ");
		      
	}
}


